package com.github.nacostwo.ui;

import java.util.List;
import java.util.UUID;

import com.github.nacostwo.entity.EsBook;
import com.github.nacostwo.service.EsBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController()
@RequestMapping("/book")
public class EsBookController {
    @Autowired
    private EsBookService esBookService;

    @RequestMapping("/create")
    public EsBook create() {
        return esBookService.create(UUID.randomUUID().toString());
    }

    @RequestMapping("/searchall")
    public List<EsBook> searchall() {
        return esBookService.searchAll();
    }

}
